const connection = require('../db/index')

const login = (data) => {
    return new Promise((resolve, reject) => {
        const { username, password } = data;
        if (
            (username !== "admin" || username !== "common") &&
            password !== "1234qwer"
        ) {
            resolve({
                code: 500,
                msg: "账号密码错误",
                data: null,
            });
        } else {
            resolve({
                code: 200,
                msg: "登录成功",
                data: data.body,
            });
        }
    })
}


module.exports = {
    login
}